﻿
// ProjectAADlg.h: 头文件
//

#pragma once
#include"MotorDlg.h"
#include"LogDlg.h"
#include "TcpipDlg.h"
#include "ChangeProjectDlg.h"
#include "IODlg.h"
#include "ControlDlg.h"
#include "SettingDlg.h"
#include "RS232Dlg.h"
#include "CUserCheckDlg.h"
#include "LoginDlg.h"
#include "CaptureDlg.h"
#include "GlueCheckDlg.h"
#include "CMesDlg.h"
#include "GlueSNCheckDlg.h"

// CProjectAADlg 对话框
class CProjectAADlg : public CDialogEx
{
// 构造
public:
	CProjectAADlg(CWnd* pParent = nullptr);	// 标准构造函数

// 对话框数据
#ifdef AFX_DESIGN_TIME
	enum { IDD = IDD_PROJECTAA_DIALOG };
#endif

	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV 支持


// 实现
protected:
	HICON m_hIcon;
	CMenu m_menu;

	// 生成的消息映射函数
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	DECLARE_MESSAGE_MAP()
	HANDLE unique_mutex;
public:
	POINT Old;

	CMotorDlg*   m_cMotorDlg = nullptr;
	CLogDlg*   m_cLogDlg = nullptr;
	CTcpipDlg*  m_cTcpipDlg = nullptr;
	CChangeProjectDlg*  m_cProjectDlg = nullptr;
	CIODlg*  m_cIODlg = nullptr;
	CControlDlg*  m_cControlDlg = nullptr;
	CSettingDlg*  m_cSettingDlg = nullptr;
	CRS232Dlg*  m_cRS232Dlg = nullptr;
	CUserCheckDlg*  m_cUserCheckDlg = nullptr;
	CLoginDlg*   m_cLoginDlg = nullptr;
	CCaptureDlg*   m_cCaptureDlg = nullptr;
	CGlueCheckDlg*   m_cGlueCheckDlg = nullptr;
	CMesDlg* m_cMesDlg = nullptr;
	CGlueSNCheckDlg* m_cGlueSNCheckDlg = nullptr;

	CBitmap Bitmap;
	HBITMAP hBitmap; 
	HBRUSH hbr;//画笔相关

	LRESULT OnReceiveServerMsg(WPARAM wParam, LPARAM lParam);
	CRect m_rcUiRect;
	CRect OriRect[200];
	int RectW[200] = { 0 };
	int RectH[200] = { 0 };
	void Repaint(CWnd * pWnd, int last_Width, int now_Width, int last_Height, int now_Height, int cnt);
	void SetUiHandle();

	afx_msg void OnOpenLogDlg();
	afx_msg void OnOpenMotorDlg();
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnOpenTcpipDlg();
	virtual void OnCancel();
	afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
	afx_msg void OnOpenProjectDlg();
	afx_msg void OnOpenIODlg();
	afx_msg void OnBnClickedButtonHome();
	afx_msg void OnBnClickedCheck10auto();
	afx_msg void OnOpenControlDlg();
	afx_msg void OnOpenSettingDlg();
	afx_msg void OnOpenRS232Dlg();
	afx_msg void OnBnClickedCheck10auto2();
	afx_msg void OnBnClickedCheck10auto3();
	virtual BOOL PreTranslateMessage(MSG* pMsg);
	afx_msg void OnBnClickedButtonHome2();
	afx_msg void OnBnClickedButtonHome3();
	afx_msg void OnBnClickedButtonHome4();
	afx_msg void OnBnClickedButton1();
	afx_msg void OnBnClickedButtonHome5();
	CStatic Static1;
	CButton Static2;
	CStatic Static3;
	CButton Static4;
	CStatic Static5;
	CStatic Static6;
	CStatic Static7;
	CStatic Static8;
	CButton Static9;
	CStatic Static10;
	CStatic Static11;
	CStatic Static12;
	CStatic Static13;
	CStatic Static14;
	CStatic Static15;
	CStatic Static16;
	CStatic Static17;
	CButton Button1;
	CButton Button2;
	CButton Button3;
	CStatic Msg1;
	CStatic Msg2;
	CStatic Msg3;
	CStatic Msg4;
	CStatic Static19;
	afx_msg void OnOpenLoginDlg();
	afx_msg void OnOpenCaptureDlg();
	CButton m_butStart;
	CButton m_butStop;
	CButton m_butSave;
	afx_msg void OnBnClickedButtonStart();
	afx_msg void OnBnClickedButtonStop();
	afx_msg void OnBnClickedButtonSave();
	CStatic Static20;
	CStatic Static21;
	afx_msg void OnBnClickedButton2();
	CStatic NGMsg;
	afx_msg void OnBnClickedButton3();
	afx_msg void OnBnClickedButton4();
	afx_msg void OnOpenGlueCheckDlg();
	afx_msg void OnMenuMes();
};
